
#include "stdafx.h"
#include "internetsecuritymanager.h"

// IUnknown
CInternetSecurityManager::CInternetSecurityManager(CWebContainer *pWebContainer)
: m_pWebContainer(pWebContainer)
, m_cRef(0)
{

}

CInternetSecurityManager::~CInternetSecurityManager()
{

}

// IUnknown
STDMETHODIMP CInternetSecurityManager::QueryInterface(REFIID riid, void **ppvObject)
{
	if (ppvObject == NULL)
		return E_INVALIDARG;

	*ppvObject = NULL;

	if (IID_IUnknown == riid || IID_IInternetSecurityManager == riid)
		*ppvObject = (IUnknown*)this;

	if (*ppvObject != NULL)
	{
		((LPUNKNOWN)(*ppvObject))->AddRef();
		return S_OK ;
	}

	return E_NOTIMPL;
}

STDMETHODIMP_(ULONG) CInternetSecurityManager::AddRef()
{
	return ++m_cRef;
}

STDMETHODIMP_(ULONG) CInternetSecurityManager::Release()
{
	long nTemp = --m_cRef;
	if (nTemp == 0)
		delete this;

	return nTemp;
}


// IInternetSecurityManager
STDMETHODIMP CInternetSecurityManager::SetSecuritySite(IInternetSecurityMgrSite *pSite)
{
	return INET_E_DEFAULT_ACTION; 
}

STDMETHODIMP CInternetSecurityManager::GetSecuritySite(IInternetSecurityMgrSite **ppSite)
{
	return INET_E_DEFAULT_ACTION; 
}

STDMETHODIMP CInternetSecurityManager::MapUrlToZone(LPCWSTR pwszUrl, DWORD *pdwZone, DWORD dwFlags)
{
	return INET_E_DEFAULT_ACTION;
}

STDMETHODIMP CInternetSecurityManager::GetSecurityId(LPCWSTR pwszUrl, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
{
	return INET_E_DEFAULT_ACTION; 
}

STDMETHODIMP CInternetSecurityManager::ProcessUrlAction(LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved)
{
	return INET_E_DEFAULT_ACTION;
}

STDMETHODIMP CInternetSecurityManager::QueryCustomPolicy(LPCWSTR pwszUrl, REFGUID guidKey, BYTE **ppPolicy, DWORD *pcbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwReserved)
{
	return INET_E_DEFAULT_ACTION; 
}

STDMETHODIMP CInternetSecurityManager::SetZoneMapping(DWORD dwZone, LPCWSTR lpszPattern, DWORD dwFlags)
{
	return INET_E_DEFAULT_ACTION; 
}

STDMETHODIMP CInternetSecurityManager::GetZoneMappings(DWORD dwZone, IEnumString **ppenumString, DWORD dwFlags)
{
	return INET_E_DEFAULT_ACTION; 
}